﻿@inherits AdminCompontentBase
@inject NavHelper NavHelper
@inject NavigationManager NavigationManager

@inject GlobalConfig GlobalConfig;

<MNavigationDrawer Class="navigation" Width=300 MiniVariantWidth=80 Fixed ExpandOnHover="GlobalConfig.ExpandOnHover" @bind-Value="IsShow" @bind-MiniVariant="GlobalConfig.NavigationMini" App>
    <div style="height:132px" class="@($"block-center {(GlobalConfig.NavigationMini?"px-4":"px-12")}")" @onclick="()=>NavigationManager.NavigateTo(GlobalVariables.DefaultRoute)">
        @if (GlobalConfig.NavigationMini)
        {
            <img height="48" width="48" class="hover-pointer" src="/img/mainLayout/logo.svg" />
        }
        else
        {
            <img class="hover-pointer" src="/img/mainLayout/logo-en.svg" />
        }
    </div>

    <MList Nav Linkage Dense Class="@($"pa-0 {(GlobalConfig.NavigationMini?"mini-navigation":"")}")">        
        <Menus MenuNavs="@NavHelper.Navs.ToArray()" />
    </MList>

</MNavigationDrawer>

@if(IsShow==true)
{
    <MButton Small Fab Color="primary" Style="@($"bottom:58px;z-index:7;position: fixed;{(GlobalConfig.NavigationMini ? "left:60px;" : "left:280px;")}")" OnClick="()=>{GlobalConfig.ExpandOnHover=!GlobalConfig.ExpandOnHover;}">
        <MIcon Class="white--text">
            @(GlobalConfig.NavigationMini?"mdi-chevron-right":"mdi-chevron-left")
        </MIcon>
    </MButton>
}

@code {
    bool? IsShow { get; set; }
}
